<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;

$this->title = '批卷';
$or = ['×','√'];
$color = ['red','green']
?>
<style>
    li{list-style:none;}
</style>
<h2><?= $examname  ?></h2>
<h4>id为 <?= $classid_papers['tid']; ?> 的试卷</h4>
        <!--nr start-->
        <div class="test_main">
            <div class="nr_left">
                <div class="test"  style="margin-bottom:45px;">
                <?php $form = ActiveForm::begin(['action' => 'endpijuan','method'=>'post', 'id'=>'testForm']); ?>

                        <input type="hidden" value="<?=$id?>" name="id">
                        <input type="hidden" value="<?=$pid?>" name="pid">
                        <div class="test_content">
                            <div class="test_content_title">
                                <h2>单选题</h2>
                                
                            </div>
                        </div>
                        <div class="test_content_nr">
                            <ul>
<!-- 单选题  -->
                            <?php foreach($examinationInfo['radio'] as $key => $value): ?>
                                <li id="radio_<?=$key ?>">
                                    <div class="test_content_nr_tt">
                                        <i><?=$key+1;?></i><span>(<?=$selscore;?>分)</span><font><?= $value['title'] ?>（ ）<font color="<?= $value['answer']==$value['ss']? 'green':'red';?>">真确答案：<?=$value['answer']?></font></font><b class="icon iconfont"></b>
                                    </div>

                                    <div class="test_content_nr_main">
                                        <ul>
                                        <?php $rares = json_decode($value['options'],1);
                                         foreach($rares as $optionskey => $optionsvalue): ?>
                                            <li class="option">

                                                <label >
                                                <input type="radio" class="radioOrCheck" 
                                                       id="0_answer_1_option_1" name="<?=$key ?>" value="<?=$controlleroptions[$key]?>"

                                                       <?=$value['ss'] == $controlleroptions[$optionskey]?'checked':'';?>
                                                       disabled
                                                        />


                                                    <?= Html::encode($controlleroptions[$optionskey])?>. 
                                                    <p class="ue" style="display: inline;"><?=Html::encode($optionsvalue);?></p>
                                                </label>
                                            </li>
                                        <?php endforeach; ?>
                                        </ul>
                                    </div>
                                </li>
                            <?php endforeach; ?>

<!-- 单选题 end -->

                            </ul>
                        </div>
                  <input type="hidden" name="sid" value="<?=$classid_papers['tid']?>">
                  <input type="hidden" name="classid" value="<?=$classid_papers['classid']?>">
                  <input type="hidden" name="paperid" value="<?=$classid_papers['paperid']?>">
                       
                        <div class="test_content">
                            <div class="test_content_title">
                                <h2>多选题</h2>
                                
                            </div>
                        </div>
                        <div class="test_content_nr">
                            <ul>
 <!--  左边多选题 -->        
                            <?php foreach($examinationInfo['checkbox'] as $k => $v): ?>
                                <li id="checkbox_<?=$k;?>">
                                    <div class="test_content_nr_tt">
                                        <i><?=$k+1;?></i><span>(<?=$chescore?$chescore:'';?>分)</span><font><?=$v['title']?>() <font color="<?= $v['answer']==$v['ss']? 'green':'red';?>">真确答案：<?=$v['answer']?></font></font>
                                    </div>

                                    <div class="test_content_nr_main">
                                        <ul>
                                            <?php $relops = json_decode($v['options']); ?>
                                            <?php foreach ($relops as $key => $value): ?>                                                
                                            <li class="option">
                                                <label>
                                                <input type="checkbox" class="radioOrCheck" 
                                                       id="1_answer_1_option_1"

                                                       value="<?=$controlleroptions[$key]?>"
                                                    <?= $v['ss'] ==$controlleroptions[$key]?'checked':'';?> disabled/>
                                                    <p class="ue" style="display: inline;"> <?=$controlleroptions[$key]?>. <?=$value;?></p>
                                                </label>
                                            </li>

                                            <?php endforeach ?>
                                          

                                        </ul>
                                    </div>
                                </li>
                            <?php endforeach; ?>
 <!--  左边多选题 end -->

                            </ul>
                        </div>

                        <!-- 判断 -->
                        <div class="test_content">
                            <div class="test_content_title">
                                <h2>判断题</h2>
                               
                            </div>
                        </div>
                        <div class="test_content_nr">
                            <ul>
                            <?php foreach ($examinationInfo['judge'] as $key => $value): 
                               
                                ?>
                                
                            
                                <li id="judge_<?=$key;?>">
                                    <div class="test_content_nr_tt">
                                        <i><?= $key+1;?></i><span></span><font><?= $value['title']; ?> （ ）
                                            <font color="<?= $value['is_true']==$value['ss']? 'lime':'red';?>">真确答案：<?=$or[$value['is_true']]?></font>
                                    </div>

                                    <div class="test_content_nr_main">
                                        <ul>

                                            <li class="option">

                                                <label>
                                                <input type="radio" class="radioOrCheck"
                                                       id="0_answer_1_option_1" value="1" <?=$value['ss']==1?'checked':'';?> disabled/>
                                                    <p class="ue" style="display: inline;">√</p>
                                                </label>
                                            </li>

                                            <li class="option">

                                                <label >
                                                <input type="radio" class="radioOrCheck" 
                                                       id="0_answer_1_option_2"  value="0" <?=$value['ss']==0?'checked':'';?> disabled/>
                                                    <p class="ue" style="display: inline;">×</p>
                                                </label>
                                            </li>

                                        </ul>
                                    </div>
                                </li>
                            <?php endforeach ?>
                            </ul>
                        </div>


                    <!-- 填空 -->
                <div class="test_content">
                    <div class="test_content_title">
                        <h2>填空题</h2>
                       
                    </div>
                </div>
                <div class="test_content_nr">
                    <ul>
                    <?php foreach ($examinationInfo['completion'] as $key => $value): ?>
                        <li id="completion_<?=$key;?>">
                            <div class="test_content_nr_tt">
                               (<?= $cmpscore;?>)分 <i><?=$key+1 ?></i><span></span><font>
                                    <?= $value['title'] ?></font><b class="icon iconfont">&#xe881;</b>
                            </div>

                            <div class="test_content_nr_main">
                                <ul>
                                    <?php for($i=0;$i<$value['inpnum'];$i++): ?>
                                    <li class="options">
                                       <div class="input-group">
                                        <span class="input-group-addon"><?= $i+1; ?>.</span>
                                        <input type="text" class="form-control" name="completion[<?=$key;?>][<?=$i;?>]" style="padding:.5rem;" value="<?=$value['ss'][$i] ?>" disabled>
                                        </div>
                                    </li>
                                    
                                    <?php endfor; ?>
                                </ul>
                            </div>
                        </li>
                        <span>打分：</span><input type="number" name="completion[<?=$key;?>]" class='form-control' max='<?= $cmpscore;?>' min='0' value='0'>
                    <?php endforeach ?>
                    </ul>
                </div>
                <!-- 填空end  -->
                        <!--  大题  -->
                 <div class="test_content">
                    <div class="test_content_title">
                        <h2>简答题</h2>
                      
                    </div>
                </div>
                <div class="test_content_nr">
                    <ul>
                    <?php foreach ($examinationInfo['boss'] as $key => $value): ?>
                        <li id="boss_<?=$key;?>">
                            <div class="test_content_nr_tt">
                                (<?= $bosscore;?>)分 <i><?=$key+1 ?></i><span></span><font>
                                    <?= $value['title'] ?></font><b class="icon iconfont">&#xe881;</b>
                            </div>

                            <div class="test_content_nr_main">
                               <textarea class="form-control" rows="10" style="width:100%;resize:none;" name="boss[<?=$key;?>]" disabled><?=$value['ss']?></textarea>
                            </div>
                        </li>
                         <span>打分：</span><input type="number" name="boss[<?=$key;?>]" class='form-control' max='<?= $bosscore;?>' min='0' value='0'>
                    <?php endforeach ?>
                    </ul>
                </div>
                <div class="test_title">
                           
                            <font><input type="submit" value="提交" id="submitbtn" class="btn btn-info"></font>
                        </div>
               <?php ActiveForm::end(); ?>
            </div>





       
    </div>